package ynu.elm;
import ynu.elm.Dao.LoadInDao;
import ynu.elm.entities.User;
import java.util.Scanner;

public class elmEntry {
    public static void main(String[] args) {
        User user = new User();
        System.out.println("请输入你的身份（商家/管理员）：");
        Scanner sc = new Scanner(System.in);
        user.getInfo().setIdentity(sc.next());
        if(user.getInfo().getIdentity().equals("商家")){
            System.out.println("请输入商家编号：");
            user.getInfo().setName(sc.next());
            System.out.println("请输入密码：");
            user.getInfo().setPassword(sc.next());
        } else if(user.getInfo().getIdentity().equals("管理员")){
            System.out.println("请输入管理员姓名：");
            user.getInfo().setName(sc.next());
            System.out.println("请输入密码：");
            user.getInfo().setPassword(sc.next());
        }else {
            System.out.println("身份输入错误！");
        }
        new LoadInDao(user);
    }
}
